package com.lenovo.smarttraffic.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.util.Log;
import android.widget.ImageView;
import android.widget.TextView;

import com.bumptech.glide.Glide;
import com.lenovo.smarttraffic.R;
import com.lenovo.smarttraffic.ui.fragment.fgBean.AdapterBean;
import com.lenovo.smarttraffic.util.CommonUtil;

public class Item1IntentActivity extends BaseActivity {
    String TAG = "Item1IntentActivity";

    private TextView tv_classify;
    private TextView tv_time;
    private AdapterBean bean;
    private TextView tv_content;
    private ImageView img;
    private String classify;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);

        Intent intent = this.getIntent();
        bean = (AdapterBean) intent.getSerializableExtra("fg1");
        classify = intent.getStringExtra("classify");
        initView();


    }

    @Override
    protected int getLayout() {
        return R.layout.activity_item1_intent;
    }

    private void initView() {
        String[] stringArray = CommonUtil.getStringArray(R.array.tab_names);
        Log.e(TAG, "initView: " + stringArray[0]);
        initToolBar(findViewById(R.id.toolbar), true, bean.getTiele());
        tv_classify = (TextView) findViewById(R.id.tv_classify);
        tv_time = (TextView) findViewById(R.id.tv_time);
        tv_content = (TextView) findViewById(R.id.tv_content);
        img = (ImageView) findViewById(R.id.img);
        tv_classify.setText(classify);
        tv_content.setText(bean.getContent());
        tv_time.setText(bean.getTime());
        Glide.with(this).load("http://192.168.1.110:8088/transportservice/" + bean.getImg()).into(img);
    }
}
